package com.young.mylib.view.edittext;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.EditText;

import com.young.mylib.R;


/**
 * Created by Young on 2018/1/24.
 */

public class LineEditText extends EditText {

    private Paint mPaint;
    /**
     * @param context
     * @param attrs
     */
    public LineEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        // TODO Auto-generated constructor stub
        mPaint = new Paint();

        mPaint.setStyle(Paint.Style.STROKE);mPaint.setStrokeWidth(3);
        mPaint.setColor(context.getResources().getColor(R.color.bg_commom));
    }

    @Override
    public void onDraw(Canvas canvas)
    {
        super.onDraw(canvas);

//      画底线
        canvas.drawLine(0,this.getHeight()-8,  this.getWidth()-1, this.getHeight()-8, mPaint);
    }
}